package com.zl.tby.vo;

import com.zl.tby.model.TbySummarizeData;
import lombok.Data;
import org.noear.wood.utils.StringUtils;

import java.math.BigDecimal;

/**
 * 概括数据管理
 * @author changpeng
 * @version 1.0
 * @since 2024/8/8 15:17
 */
@Data
public class TbySummarizeDataBean extends TbySummarizeData {
    /**保护区总面积*/
    private BigDecimal reserveArea;
    /**核心区总面积*/
    private BigDecimal coreArea;
    /**缓冲区总面积*/
    private BigDecimal bufferArea;
    /**实验区总面积*/
    private BigDecimal experimentalArea;
    /**省份森林覆盖率*/
    private BigDecimal provinceForest;
    /**第一个城市的森林覆盖率*/
    private BigDecimal cityOneForest;
    /**第二个城市的森林覆盖率*/
    private BigDecimal cityTwoForest;
    /**保护区森林覆盖率*/
    private BigDecimal reserveForest;
    /**第一个主要保护物种*/
    private Long speciesOneId;
    private String speciesOneName;
    private String speciesOneShortName;
    private String speciesOneFile;
    private String speciesOneGisImage;
    private String speciesOneGisImageLongitude;
    private String speciesOneGisImageLatitude;
    private String speciesOneLayerCode;
    private String speciesOneLngLatArray;
    /**物种面积*/
    private BigDecimal speciesOneArea;
    /**第二个主要保护物种*/
    private Long speciesTwoId;
    private String speciesTwoName;
    private String speciesTwoShortName;
    private String speciesTwoFile;
    private String speciesTwoGisImage;
    private String speciesTwoGisImageLongitude;
    private String speciesTwoGisImageLatitude;
    private String speciesTwoLayerCode;
    private String speciesTwoLngLatArray;
    /**物种面积*/
    private BigDecimal speciesTwoArea;
    /**第三个主要保护物种*/
    private Long speciesThreeId;
    private String speciesThreeName;
    private String speciesThreeShortName;
    private String speciesThreeFile;
    private String speciesThreeGisImage;
    private String speciesThreeGisImageLongitude;
    private String speciesThreeGisImageLatitude;
    private String speciesThreeLayerCode;
    private String speciesThreeLngLatArray;
    /**物种面积*/
    private BigDecimal speciesThreeArea;
    /**蕨类植物占全省比例*/
    private BigDecimal fernProvince;
    /**裸子植物占全省比例*/
    private BigDecimal gymnospermProvince;
    /**被子植物占全省比例*/
    private BigDecimal angiospermProvince;
    /**蕨类植物占保护区比例*/
    private BigDecimal fernReserve;
    /**裸子植物占保护区比例*/
    private BigDecimal gymnospermReserve;
    /**被子植物占保护区比例*/
    private BigDecimal angiospermReserve;
    /**鸟类占全省比例*/
    private BigDecimal birdsProvince;
    /**鸟类占保护区比例*/
    private BigDecimal birdsReserve;
    /**哺乳类占全省比例*/
    private BigDecimal mammalsProvince;
    /**哺乳类占保护区比例*/
    private BigDecimal mammalsReserve;
    /**两栖类占全省比例*/
    private BigDecimal amphibiansProvince;
    /**两栖类占保护区比例*/
    private BigDecimal amphibiansReserve;
    /**爬行类占全省比例*/
    private BigDecimal crawlersProvince;
    /**爬行类占保护区比例*/
    private BigDecimal crawlersReserve;
    /**昆虫类占全省比例*/
    private BigDecimal insectsProvince;
    /**昆虫类占保护区比例*/
    private BigDecimal insectsReserve;
    /**鱼类占全省比例*/
    private BigDecimal fishProvince;
    /**鱼类占保护区比例*/
    private BigDecimal fishReserve;
    /**总碳汇量*/
    private BigDecimal carbon;
    /**涵养水源*/
    private BigDecimal waterConservation;
    /**固土量*/
    private BigDecimal soilReinforcement;
    /**年滞尘量*/
    private BigDecimal keepDustDown;
    /**年保肥量*/
    private BigDecimal fertilizerPreservation;
    /**年吸收大气污染物*/
    private BigDecimal pollutant;

    public static TbySummarizeDataBean convertByEntity(TbySummarizeData entity, TbyAnimalPlantUseOverviewBean one, TbyAnimalPlantUseOverviewBean two, TbyAnimalPlantUseOverviewBean three) {
        TbySummarizeDataBean bean = new TbySummarizeDataBean();
        bean.setId(entity.getId());
        bean.setReserveArea(entity.getReserveArea());
        bean.setCoreArea(entity.getCoreArea());
        bean.setBufferArea(entity.getBufferArea());
        bean.setExperimentalArea(entity.getExperimentalArea());
        bean.setProvinceForest(entity.getProvinceForest());
        bean.setCityOneForest(entity.getCityOneForest());
        bean.setCityTwoForest(entity.getCityTwoForest());
        bean.setReserveForest(entity.getReserveForest());
        bean.setSpeciesOneId(entity.getSpeciesOneId());
        if (one != null) {
            bean.setSpeciesOneName(one.getName());
            bean.setSpeciesOneShortName(one.getName());
            if (StringUtils.isNotEmpty(one.getName()) && one.getName().length() > 5) {
                bean.setSpeciesOneShortName(one.getName().substring(0, 4) + "...");
            }
            bean.setSpeciesOneFile(one.getFile());
            bean.setSpeciesOneGisImage(one.getImage());
            bean.setSpeciesOneGisImageLongitude(one.getLng());
            bean.setSpeciesOneGisImageLatitude(one.getLat());
            bean.setSpeciesOneLayerCode(one.getCode());
            bean.setSpeciesOneLngLatArray(one.getLngLatArray());
        }
        bean.setSpeciesOneArea(entity.getSpeciesOneArea());
        bean.setSpeciesTwoId(entity.getSpeciesTwoId());
        if (two != null) {
            bean.setSpeciesTwoName(two.getName());
            bean.setSpeciesTwoShortName(two.getName());
            if (StringUtils.isNotEmpty(two.getName()) && two.getName().length() > 5) {
                bean.setSpeciesTwoShortName(two.getName().substring(0, 4) + "...");
            }
            bean.setSpeciesTwoFile(two.getFile());
            bean.setSpeciesTwoGisImage(two.getImage());
            bean.setSpeciesTwoGisImageLongitude(two.getLng());
            bean.setSpeciesTwoGisImageLatitude(two.getLat());
            bean.setSpeciesTwoLayerCode(two.getCode());
            bean.setSpeciesTwoLngLatArray(two.getLngLatArray());
        }
        bean.setSpeciesTwoArea(entity.getSpeciesTwoArea());
        bean.setSpeciesThreeId(entity.getSpeciesThreeId());
        if (three != null) {
            bean.setSpeciesThreeName(three.getName());
            bean.setSpeciesThreeShortName(three.getName());
            if (StringUtils.isNotEmpty(three.getName()) && three.getName().length() > 5) {
                bean.setSpeciesThreeShortName(three.getName().substring(0, 4) + "...");
            }
            bean.setSpeciesThreeFile(three.getFile());
            bean.setSpeciesThreeGisImage(three.getImage());
            bean.setSpeciesThreeGisImageLongitude(three.getLng());
            bean.setSpeciesThreeGisImageLatitude(three.getLat());
            bean.setSpeciesThreeLayerCode(three.getCode());
            bean.setSpeciesThreeLngLatArray(three.getLngLatArray());
        }
        bean.setSpeciesThreeArea(entity.getSpeciesThreeArea());
        bean.setFernProvince(entity.getFernProvince());
        bean.setGymnospermProvince(entity.getGymnospermProvince());
        bean.setAngiospermProvince(entity.getAngiospermProvince());
        bean.setFernReserve(entity.getFernReserve());
        bean.setGymnospermReserve(entity.getGymnospermReserve());
        bean.setAngiospermReserve(entity.getAngiospermReserve());
        bean.setBirdsProvince(entity.getBirdsProvince());
        bean.setBirdsReserve(entity.getBirdsReserve());
        bean.setMammalsProvince(entity.getMammalsProvince());
        bean.setMammalsReserve(entity.getMammalsReserve());
        bean.setAmphibiansProvince(entity.getAmphibiansProvince());
        bean.setAmphibiansReserve(entity.getAmphibiansReserve());
        bean.setCrawlersProvince(entity.getCrawlersProvince());
        bean.setCrawlersReserve(entity.getCrawlersReserve());
        bean.setInsectsProvince(entity.getInsectsProvince());
        bean.setInsectsReserve(entity.getInsectsReserve());
        bean.setFishProvince(entity.getFishProvince());
        bean.setFishReserve(entity.getFishReserve());
        bean.setCarbon(entity.getCarbon());
        bean.setWaterConservation(entity.getWaterConservation());
        bean.setSoilReinforcement(entity.getSoilReinforcement());
        bean.setKeepDustDown(entity.getKeepDustDown());
        bean.setFertilizerPreservation(entity.getFertilizerPreservation());
        bean.setPollutant(entity.getPollutant());
        return bean;
    }
}
